1. Field of the Invention
The present invention relates to an encoding apparatus for encoding an image and, more particularly, to a stereo image encoding apparatus for encoding a stereo image which is formed by using a plurality of images picked up by a plurality of image pickup units.
2. Description of the Related Art
In recent years, in association with a spread of a display which can display a stereo image, an attention has also been paid to an image pickup apparatus which can photograph a stereo image. The stereo image is generally formed by using a right image and a left image which were respectively photographed by two cameras having a parallax. As a technique for encoding an image, a compression encoding/decoding technique using a motion prediction which searches for a motion vector between images in a time base direction in such a manner that is used in an MPEG method and the like has been known in the related art. In addition to such a technique, an encoding method using a parallax prediction which searches for a vector due to a parallax between a right camera and a left camera (hereinbelow, referred to as a parallax vector) has also been known (refer to the Official Gazette of Japanese Patent Application Laid-Open No. 2000-165909).
Japanese Patent Application Laid-Open No. 2000-165909 discloses an encoding apparatus in which, for example, a stereo image photographed by two cameras disposed in parallel is compression-encoded by using a parallax prediction. Particularly, it discloses such a technique that on the basis of such a parallax between the cameras that an object image is picked up by the left camera is picked up by the right camera at a position certainly having an offset in the left direction, a search range of the parallax prediction to an image picked up by the right camera is set to the position having an offset in the left direction.
In the related art, in the case of a stereo-encoding for providing a depth in an image, in consideration of an offset based on such a parallax that an object in an image viewed by the left eye has certainly an offset in the left direction in the right eye, for example, such a technique that a search range of the parallax prediction is set to the position having an offset in the left direction from the same position as that of the object in the image on a display screen or the like is used.
However, in the related art, although the direction of the parallax is considered, an offset amount of the search range is constant at any position in the display screen. Therefore, in the case where distances to the objects in the display screen differ or the like, the search range cannot be always properly set and there is a fear that a correct parallax vector cannot be detected.
In an image pickup apparatus in which a right camera and a left camera are horizontally disposed in one casing, generally, only an offset of an image in the horizontal direction that is caused by the parallax between two cameras occurs. However, in the case of an image pickup apparatus in which each camera has a rotation correction function, there is a case where, upon photographing, an offset in the vertical direction occurs in the image photographed by each camera due to an influence by a vibration or the like caused by a photographer. In view of this, in the above related art, although the offset in the horizontal direction based on the parallax is considered, it cannot cope with the offset in the vertical direction. Therefore, in the above related art, since the offset in the vertical direction that is caused by the differences among the positions of a plurality of cameras is not considered, such a problem that the proper search range is not set and a precision of the parallax vector prediction deteriorates occurs.